<?php
{
echo '<div style="text-align:left;">';
echo '<ul type="square">';
$question=$_REQUEST['ques'];

$qu=mysql_query("select * from faq where faq like '%$question%'");
if(mysql_num_rows($qu)>0)
	{
		while($row=mysql_fetch_array($qu))
		{
			echo '<li><b>'.$row['faq'].'</b>';
		$faq_id=$row['faq_id'];
			$ans=mysql_query("select * from answers where faq_id=".$faq_id);
			echo '<ul>';
			$i="1";
			while($res=mysql_fetch_array($ans))
			{
				echo '<li>Ans&nbsp;'.$i.'&nbsp; - '.$res['answers'].'</li>';
				$i++;
			}
			echo '</ul></li>';
		}
	}
	else
	{
		echo "Question does not exist.";
	}
echo '</ul>';
}

?>